<template>
  <section class="custSelect" >
    <el-dialog v-dialogDrag
      :close-on-click-modal="false"
      title="目标客户导入"
      :append-to-body="true"
      :visible.sync="visible"
      @close="visible=false"
      width="800px"

    >
      <dialogHeader
        slot="title"
        :title="'目标客户导入'"
        :styleType="$store.state.app.dialogType"
      ></dialogHeader>
    <div class="filter-container-crm filter-params-crm">
      <crmGroupForm
        :dynamicComponentss="tableComponents"
        :values="formField"
        :ref="ref"
      />
      <el-row>
        <el-col span="12">
          <label >导入文件</label>
          <el-upload class="upload-demo" ref="upload" :on-change="handleChange" accept=".xls,.xlsx" :show-file-list="false">
            <el-input v-model="file.name" size="small" placeholder="请选择文件" readonly style="width:253px;"/>
          </el-upload>
        </el-col>
        <el-col span="12" style="text-align:left;">
          <el-button style="margin-right: 10px;" size="small" @click="submitUpload">导入</el-button>
          <a class="linkFont" href="/template/crm/线索单导入模板.xlsx" download="线索单导入模板.xlsx">模板下载</a>
        </el-col>
      </el-row>
    </div>

    </el-dialog>
  </section>
</template>
<script>
import { formMixins } from "@/components/mixins/formMixins";
import { crmApis } from "@/api/apiList/crm";
import OneTableTemplate from "@/components/crm/Template/crmonePage";
import crmGroupForm from "@/components/crm/commonComponents/crmGroupForm";

export default {
  // 组件混入对象
  mixins: [formMixins],
  components:{
    OneTableTemplate,
    crmGroupForm,
    dialogHeader: () => import("@/components/dialogHeader") //弹窗标题
  },
  data() {
    return {
      visible:false,
      file:{
        name:""
      },
      tableComponents:[
        // {
        //   compKey: "compKey1",
        //   labelName: "批次号",
        //   codeField: "custName",
        //   component: () => import("@/components/org/commonInput"),
        //   type: "inputText",
        //   isMust: true,
        //   disabled:true,
        //   span:12
        // },
        {
          compKey: "compKey2",
          labelName: "导入名称",
          codeField: "custName",
          component: () => import("@/components/org/commonInput"),
          type: "inputText",
          isMust: true,
          isRequire: true,
          span:12
        },

      ],
      formField:{

      }
    }
  },
  methods:{
    handleChange(file, fileList){
      this.file.name=file.name
    }
  }
}
</script>
<style scoped>

</style>
